
<!--  Add Article  -->
<?php

if (isset($_GET["admin"]) && $_GET["parameter"] == "addarticle")
    { ?>

    <form method="post" action="">
    <p>Article title: <input name="ArticlTitle" type="text" /></p>
    <p>Article text: <textarea name="Article"></textarea></p>
    <p><input name="ArtSub" type="submit" value=" add article " /></p>
    </form>



<?php }
/*------ Function admin ------------*/

if (isset($_POST["ArtSub"]))
{
     
     $titleArt = htmlspecialchars($_POST["ArticlTitle"]);
     $artart = htmlspecialchars($_POST["Article"]);
     
     $queryart = "INSERT INTO `article` (`ArticlTitle`,`Article`,`CreateDate`) 
                VALUES ('".$titleArt."','".$artart."',NOW())";
     
     $connectionadd = connect($config);
     
     insertquery($queryart,$connectionadd);
     
     echo "<script>alert('Ok')</script>";
     
     unset($_GET['parameter']);

     
     
}
?>